load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "revertccl",
    srcs = [
        "alter_reset_tenant.go",
        "revert.go",
        "revert_tenant.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/revertccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/utilccl",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/multitenant/mtinfopb",
        "//pkg/roachpb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/sql",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/clusterunique",
        "//pkg/sql/exprutil",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/asof",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessionprotectedts",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "//pkg/util/tracing",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@org_golang_x_sync//errgroup",
    ],
)

go_test(
    name = "revertccl_test",
    srcs = [
        "main_test.go",
        "revert_test.go",
    ],
    embed = [":revertccl"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/storageccl",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/sql",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/sem/catid",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//require",
    ],
)
